<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../react18/react.development.js"></script>
  <script src="../react18/react-dom.development.js"></script>
  <script src="../react18//babel.min.js"></script>
</head>
<body>
  <div id="app"> </div>
  <script type="text/babel">
    // 非组件定义,而是一个封装函数返回一个虚拟DOM
    /* 
      缺点:
        -识别性不高,一般组件的调用是使用大写的标签调用 eg:<Title/>
        -不具备组件拥有的功能(hook等)
        -开发者工具也不会识别
    */

    function title(){
      return <h1>标题</h1>
    }

    const root=ReactDOM.createRoot(document.getElementById("app"))
    root.render(title())
  </script>
</body>
</html>